class Solution {
    vector<vector<int>> result;
    vector<int> path;

    void backTracking(const vector<int>& nums, int startIndex)
    {
        if (path.size() >= 2) result.push_back(path);
        unordered_set<int> hash;
        for (int i = startIndex; i < nums.size(); ++i)
        {
            if (hash.find(nums[i]) != hash.end()) continue;
            if (!path.empty() && path.back() > nums[i]) continue;
            path.push_back(nums[i]);
            hash.insert(nums[i]);
            backTracking(nums, i + 1);
            path.pop_back();
        }
    }
public:
    vector<vector<int>> findSubsequences(vector<int>& nums) {
        backTracking(nums, 0);
        return result;
    }
};